/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.click.app.service.impl;

import com.click.app.dao.DistinctiveDao;
import com.click.app.model.Distinctive;
import com.click.app.model.Material;
import com.click.app.service.DistinctiveManager;
import java.util.List;

/**
 *
 * @author orgale
 */
public class DistinctiveManagerImpl extends GenericManagerImpl<Distinctive, Long> implements DistinctiveManager {

    DistinctiveDao distinctiveDao;

    public DistinctiveManagerImpl(DistinctiveDao distinctiveDao) {
        super(distinctiveDao);
        this.distinctiveDao = distinctiveDao;
    }

    public List<Distinctive> findById(Long id) {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public List<Distinctive> findByMaterial(Material material) {
        return distinctiveDao.findByMaterial(material);
    }

    public List<Distinctive> findDistinctives() {
        return distinctiveDao.findDistinctives();
    }

    public List<Distinctive> findDistinctivesName(String name){
        return distinctiveDao.findDistinctivesName(name);
    }

    public Distinctive findDistinctivesByValue(String value){
        return distinctiveDao.findDistinctivesName(value).get(0);
    }


    public List<String> distinctivesNames(){
        return distinctiveDao.distinctivesNames();
    }

    public List<Distinctive> findDistinctivesByNameAndValue(String name, String value){
        return distinctiveDao.findDistinctivesByNameAndValue(name, value);
    }
}
